﻿using System.Windows;
using SGT.ViewModel;
using System.Windows.Controls;
using SGT.Views;

namespace SGT
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private Page _ABMProvedores;
        private Page _ABMDepositos;
        private Page _ABMMercaderias;
   
        
        public MainWindow()
        {
            InitializeComponent();
            Closing += (s, e) => ViewModelLocator.Cleanup();
            _ABMDepositos = new ABMDepositosView();
            _ABMProvedores = new ABMProvedoresView();
            
        }

        private void AdministrarProveedores_Click(object sender, RoutedEventArgs e)
        {
            this.frame1.Navigate(_ABMProvedores);
        }

        private void AdministrarDepositos_Click(object sender, RoutedEventArgs e)
        {
            this.frame1.Navigate(_ABMDepositos);
        }
        private void AdministrarMercaderias_Click(object sender, RoutedEventArgs e)
        {
            if (_ABMMercaderias == null)
                _ABMMercaderias = new ABMMercaderiasView();
            this.frame1.Navigate(_ABMMercaderias);
        }
    }
}
